<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IFWiki.Models.Game>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Source: '<%= Html.Encode(Model.Name) %>'</title>
	<link href="/Content/Prettify/prettify.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="menu" runat="server">
            <div id="menucontainer">
                <ul id="menu">              
                    <li><%= Html.ActionLink("Main", "Index", "Game", new { name = Model.Name }, null)%></li>
                    <li><a class="current">Source</a></li>                                    
                    <li><%= Html.ActionLink("Talk", "Talk", "Article", new { name = Model.Name, innerType = Model.InnerType }, null)%></li>
                </ul>
            
            </div>
        </div>
  </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

            <div id="submenucontainer">
                <ul id="submenu">              
                    <li><a class="current">Source</a></li>                
<%
    if (Request.IsAuthenticated)
    {
%>
                    <li><%= Html.ActionLink("Edit", "Edit", "Game", new { name = Model.Name }, null)%></li>
<%
    }
%>                    
                    <li><%= Html.ActionLink("History", "ListRevisions", "Game", new { name = Model.Name }, null)%></li>

                </ul>
            </div>

    <h2>Source: '<%= Html.Encode(Model.Name) %>'</h2>

        <p>
            About Game: 
            <%= Html.Encode(Model.AboutGame) %>
        </p>
        <p>
            Starting Player Json: 
            <pre><code><%= Html.Encode(Model.StartingPlayerJson) %></code></pre>
        </p>
        <p>
            Starting Game Place Name: 
            <%= Html.Encode(Model.StartingGamePlaceName) %>
        </p>
        <p>
            Game Style: 
            <%= Html.Encode(Model.GameStyle) %>
        </p>
        <p>
            On Place Enter JS: 
            <pre><code><%= Html.Encode(Model.OnPlaceEnterJS) %></pre></code>
        </p>
        
<%
    if (Request.IsAuthenticated)
    {
%>
    <p>
        <%=Html.ActionLink("Edit", "Edit", new { name=Model.Name }) %> 
    </p>
<%
    }
    else
    {
%>  
    <p class="note"><%= Html.ActionLink("Login", "Login", "Account") %>  to allow  edit</p>
<%
    }
%>      
    <script type="text/javascript">
        $(document).ready(function() {

            // add prettyprint class to all <pre><code></code></pre> blocks
            var prettify = false;
            $("pre code").parent().each(function() {
                $(this).addClass('prettyprint');
                prettify = true;
            });

            // if code blocks were found, bring in the prettifier ...
            if (prettify) {
                // do it via ajax instead of getScript to avoid cache busting.
                $.ajax({
                  type: 'GET',
                  url: '/Scripts/prettify.js',
                  cache: true,
                  success: function() { prettyPrint() },
                  dataType: 'script',
                  data: null
                });
            }

        });
    </script>
        

</asp:Content>

